package com.woniuxy.demo.epai.controller;


import com.woniuxy.demo.epai.common.Result;
import com.woniuxy.demo.epai.model.Artical;
import com.woniuxy.demo.epai.service.IArticalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 文章表 前端控制器
 * </p>
 *
 * @author epai
 * @since 2021-04-12
 */
@RestController
@RequestMapping("/epai/artical")
@Slf4j
public class ArticalController {
    @Autowired
    private IArticalService articalService;

    @GetMapping("/getartical")
    public Result gettartical(int cid){
        log.info("查询文章类型{}",cid);
        List<Artical> articals = articalService.queryByCid(cid);
        return Result.success(articals);
    }
}

